import React, {Component} from 'react'
import { FormattedMessage } from 'react-intl'
import { hashHistory } from 'react-router'
import { Icon, Button, Toast } from 'antd-mobile'
import { CommonHeader } from 'component/header'
import { SideLeftRight } from 'component/common'

export default class AccountCondition extends Component {
  loginOut = () => {
    Toast.success('注销成功！', 1.2, () => {
      localStorage.removeItem('ccy')
      localStorage.removeItem('all')
      localStorage.removeItem('token')
      hashHistory.push('/')
    })
  }
  render() {
    return (
      <div className="-background">
        <CommonHeader
          title={<FormattedMessage id="accountStatus"/>}
        />
        <div className="cm-scrollable-container rt-bg-grey">
          <SideLeftRight
            left={
              <span>
                <FormattedMessage id="deposit"/>
                <span>／</span>
                <FormattedMessage id="withdraw"/>
              </span>
            }
            right={<Icon type="right"/>}
            className="rt-side-height"
          />
          <SideLeftRight
            left={<FormattedMessage id="incomeDetail"/>}
            right={<Icon type="right"/>}
            className="rt-side-height"
          />
          <Button
            className="cm-main-button -white -no-border-radius rt-margin-top50"
            onClick={
              () => {
                this.loginOut()
              }
            }
          >
            <FormattedMessage id="signOut"/>
          </Button>
        </div>
        
      </div>
    )
  }
}
